package com.xiaoshuidi.cloud.module.rooms.controller.app.reserve;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.framework.common.pojo.PageResult;
import com.xiaoshuidi.cloud.module.rooms.controller.app.reserve.vo.MyReservePageRespVO;
import com.xiaoshuidi.cloud.module.rooms.enums.ApiConstants;
import com.xiaoshuidi.cloud.module.rooms.service.IRoomHouseReserveService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "租客端 - 预定相关接口")
@RestController
@RequiredArgsConstructor
@RequestMapping(ApiConstants.NAME + "/reserve")
public class ReserveController {

    private final IRoomHouseReserveService roomHouseReserveService;

    @Operation(summary = "查询我的预定")
    @GetMapping("/get-my-reserve")
    @Parameters({
            @Parameter(name = "pageNum", description = "页码"),
            @Parameter(name = "pageSize", description = "页大小"),
            @Parameter(name = "payState", description = "支付状态 0:全部 1:待支付 2:已支付"),
            @Parameter(name = "bookerPhone", description = "预订人手机号", required = true)
    })
    public CommonResult<PageResult<MyReservePageRespVO>> getMyReserve(Integer pageNum, Integer pageSize, Integer payState, String bookerPhone){
        return roomHouseReserveService.getMyReserve(pageNum, pageSize, payState, bookerPhone);
    }

}
